﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MpSoft.Library.DAO.Customers;
using MpSoft.Library.DTO;
using MpSoft.Basic.Configuration;

namespace MpSoft.Library.BUSS.Customers
{

    #region  Contact
    public class ContactBUSS
    {
     
        public static int Contact_Add(Contact obj)
        {
            var result = ContactDAO.Contact_Add(obj);
            return result;
        }
        public static int Contact_Update(Contact obj)
        {
            var result = ContactDAO.Contact_Update(obj);
            return result;
        }

        public static int Contact_Delete(int ContactID)
        {
            var result = ContactDAO.Contact_Delete(ContactID);
            return result;
        }

        public static Contact Contact_ByID(int ContactID)
        {
            if (ContactID > 0)
            {
                var list = Contact_List(ContactID, null);
                if (list != null)
                    return list.FirstOrDefault();
            }
            return null;
        }

        public static List<Contact> Contact_List(int ContactID, string Email)
        {
            return ContactDAO.Contact_List(ContactID, Email);
        }
    }
    #endregion

}
